usdai: switch monitoring to pyusd backing and peg checks#199
Open
ctmotox2 wants to merge 3 commits intoyearn:mainfrom
Open
usdai: switch monitoring to pyusd backing and peg checks#199ctmotox2 wants to merge 3 commits intoyearn:mainfrom
ctmotox2 wants to merge 3 commits intoyearn:mainfrom
Conversation
tapired
reviewed
Apr 9, 2026
|
|
||
| usdai_supply_fmt = usdai_supply_raw / (10**usdai_decimals) | ||
| pyusd_assets_fmt = pyusd_assets_raw / (10**pyusd_decimals) | ||
| backing_ratio = (pyusd_assets_fmt / usdai_supply_fmt) if usdai_supply_fmt > 0 else 0 |
Collaborator
There was a problem hiding this comment.
what about the USDai backed by loans? It is not like that always pyUSD > USDai supply because of the loans. Am I missing out smth here?
| USDAI_PYUSD_WARN_DEVIATION = Config.get_env_float("USDAI_PYUSD_WARN_DEVIATION", 0.003) # 0.30% | ||
| USDAI_PYUSD_CRITICAL_DEVIATION = Config.get_env_float("USDAI_PYUSD_CRITICAL_DEVIATION", 0.01) # 1.00% | ||
| PYUSD_USD_WARN_DEVIATION = Config.get_env_float("PYUSD_USD_WARN_DEVIATION", 0.003) # 0.30% | ||
| PYUSD_USD_CRITICAL_DEVIATION = Config.get_env_float("PYUSD_USD_CRITICAL_DEVIATION", 0.0075) # 0.75% |
Collaborator
There was a problem hiding this comment.
that basically means the backing is 0.25?
| pyusd_key = f"{Chain.ARBITRUM.network_name}:{PYUSD_TOKEN_ADDR.lower()}" | ||
| pyusd_price = None | ||
| try: | ||
| prices = fetch_prices([pyusd_key]) |
Collaborator
There was a problem hiding this comment.
how is this price is fetched?
| from utils.config import Config | ||
| from utils.logging import get_logger | ||
| from utils.web3_wrapper import ChainManager | ||
|
|
Collaborator
There was a problem hiding this comment.
this file is overall great but can we make it generic to any ERC20 instead of only for usdai?
maybe make this large_mints.py in a different folder and generic such that it can work with say iUSD, USDC etc?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.